from django.db import models


class TaskExec(models.Model):
      id = models.AutoField(primary_key=True)
      def __str__(self):
            return str(self.id)
      class Meta:
            verbose_name="单任务执行"
            verbose_name_plural = verbose_name

class Task(models.Model):
      STATUS_CHOICES = (
          ('build', '打包'),
          ('deploy', '发布'),
          ('rollback', '回滚'),
      )

      id = models.AutoField(primary_key=True)
      name = models.CharField(verbose_name='任务名', max_length=64)
      status = models.CharField(max_length=8, choices=STATUS_CHOICES, default='build')

      def __str__(self):
        return self.name
      class Meta:
            verbose_name="任务查询"
            verbose_name_plural = verbose_name
